<!doctype html>
<html><head><meta charset="utf-8">
<title>lib/ccv_basic.c</title>
<link rel="stylesheet" href="/stylesheets/styles.css">
<link rel="stylesheet" href="/stylesheets/coderay.css">
<script src="/javascripts/scale.fix.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-303081-6']);
_gaq.push(['_trackPageview']);
(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head><body><div class="wrapper">
<header><h1><a href="/">ccv</a></h1>
<p>A Modern Computer Vision Library</p>
<p class="view"><a href="https://github.com/liuliu/ccv">View the Project on GitHub <small>liuliu/ccv</small></a></p>
<ul>
<li><a href="https://github.com/liuliu/ccv/zipball/stable">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/liuliu/ccv/tarball/stable">Download <strong>TAR Ball</strong></a></li>
<li><a href="https://github.com/liuliu/ccv">Fork On <strong>GitHub</strong></a></li>
</ul>
</header>
<section><h1>lib/ccv_basic.c</h1>
<h2 id="ccvsobel">ccv_sobel</h2>

<pre><code>void ccv_sobel(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, int dx, int dy)
</code></pre>

<p>Compute image with <a href="https://en.wikipedia.org/wiki/Sobel_operator">Sobel operator</a>.</p>

<ul>
  <li><strong>a</strong>: the input matrix.</li>
  <li><strong>b</strong>: the output matrix.</li>
  <li><strong>type</strong>: the type of output matrix, if 0, ccv will try to match the input matrix for appropriate type.</li>
  <li><strong>dx</strong>: the window size of Sobel operator on x-axis, specially optimized for 1, 3</li>
  <li><strong>dy</strong>: the window size of Sobel operator on y-axis, specially optimized for 1, 3</li>
</ul>

<h2 id="ccvgradient">ccv_gradient</h2>

<pre><code>void ccv_gradient(ccv_dense_matrix_t* a, ccv_dense_matrix_t** theta, int ttype, ccv_dense_matrix_t** m, int mtype, int dx, int dy)
</code></pre>

<p>Compute the gradient (angle and magnitude) at each pixel.</p>

<ul>
  <li><strong>a</strong>: the input matrix.</li>
  <li><strong>theta</strong>: the output matrix of angle at each pixel.</li>
  <li><strong>ttype</strong>: the type of output matrix, if 0, ccv will defaults to CCV_32F.</li>
  <li><strong>m</strong>: the output matrix of magnitude at each pixel.</li>
  <li><strong>mtype</strong>: the type of output matrix, if 0, ccv will defaults to CCV_32F.</li>
  <li><strong>dx</strong>: the window size of the underlying Sobel operator used on x-axis, specially optimized for 1, 3</li>
  <li><strong>dy</strong>: the window size of the underlying Sobel operator used on y-axis, specially optimized for 1, 3</li>
</ul>

<h2 id="ccvflip">ccv_flip</h2>

<pre><code>void ccv_flip(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int btype, int type)
</code></pre>

<p>Flip the matrix by x-axis, y-axis or both.</p>

<ul>
  <li><strong>a</strong>: the input matrix.</li>
  <li><strong>b</strong>: the output matrix (it is in-place safe).</li>
  <li><strong>btype</strong>: the type of output matrix, if 0, ccv will use the sample type as the input matrix.</li>
  <li><strong>type</strong>: CCV_FLIP_X - flip around x-axis, CCV_FLIP_Y - flip around y-axis.</li>
</ul>

<h2 id="ccvblur">ccv_blur</h2>

<pre><code>void ccv_blur(ccv_dense_matrix_t* a, ccv_dense_matrix_t** b, int type, double sigma)
</code></pre>

<p>Using <a href="https://en.wikipedia.org/wiki/Gaussian_blur">Gaussian blur</a> on a given matrix. It implements a O(n * sqrt(m)) algorithm, n is the size of input matrix, m is the size of Gaussian filtering kernel.</p>

<ul>
  <li><strong>a</strong>: the input matrix.</li>
  <li><strong>b</strong>: the output matrix.</li>
  <li><strong>type</strong>: the type of output matrix, if 0, ccv will try to match the input matrix for appropriate type.</li>
  <li><strong>sigma</strong>: the sigma factor in Gaussian filtering kernel.</li>
</ul>

<h3><a href="/">&lsaquo;&nbsp;&nbsp;back&nbsp;</a></h3>
<div id="disqus_thread"></div>
<script type="text/javascript">
	var disqus_shortname = 'libccv';
	(function() {
		var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
		dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
		(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
	})();
</script>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

</section>
<footer>
<p>This project is maintained by <a href="https://liuliu.me/">liuliu</a></p>
<p><small>Theme originated from <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
</body>
</html>
